﻿<UserControl x:Class="Undercover.View.Game.GameSetupControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:interactivity ="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
    xmlns:command="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WP8"
    xmlns:converter="clr-namespace:Undercover.ViewModel"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    d:DesignHeight="480" d:DesignWidth="480">
    
    <Grid x:Name="LayoutRoot" Background="{StaticResource PhoneChromeBrush}">
        <StackPanel>
            <StackPanel.Resources>
                <converter:WordPairSourceConverter x:Key="WordPairSourceConverter" />
            </StackPanel.Resources>
            <TextBlock Text="角色数量比例（人:傻子:鬼）"/>
            <TextBox Text="{Binding RoleRatio}"/>
            <TextBlock Text="选择词源" />
            <RadioButton Content="{Binding TreasureDescription}" GroupName="WordSourceGroup"
                             IsChecked="{Binding Converter={StaticResource WordPairSourceConverter}, ConverterParameter=Treasure, Mode=TwoWay, Path=WordsSource}"
                             />
            <RadioButton Content="{Binding UserLibraryDescription}" GroupName="WordSourceGroup"
                             IsChecked="{Binding Converter={StaticResource WordPairSourceConverter}, ConverterParameter=UserLibrary, Mode=TwoWay, Path=WordsSource}"
                             />
            <RadioButton Content="{Binding CustomWordsDescription}" GroupName="WordSourceGroup"
                             Command="{Binding CreateNewWordsCommand}"
                             IsChecked="{Binding Converter={StaticResource WordPairSourceConverter}, ConverterParameter=Custom, Mode=TwoWay, Path=WordsSource}"
                             >
                <interactivity:Interaction.Triggers>
                    <interactivity:EventTrigger EventName="DoubleTap">
                        <command:EventToCommand Command="{Binding ChangeWordsCommand}"/>
                    </interactivity:EventTrigger>
                </interactivity:Interaction.Triggers>
            </RadioButton>
        </StackPanel>
        <StackPanel VerticalAlignment="Bottom">
            <Button Content="下一步" Command="{Binding CheckAndStartCommand}"/>
        </StackPanel>

    </Grid>
</UserControl>